// fast4j - Fast & Agile Service Tools for Java
// Copyright (C) 2007 Alexandre ROMAN
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

// $Id: ApplicationCreator.java 81 2007-05-01 23:35:08Z alexandre.roman $

package fast4j.ace;

import java.io.File;
import java.util.Set;

/**
 * Application creator interface. This interface is the main entry point to
 * application generation. Implement this interface if you want to create a new
 * code generator. Then, add a file named
 * <code>fast4j.ace.ApplicationCreator</code> in the
 * <code>META-INF/services/</code> directory in your JAR file, where the
 * first line contains your full qualified class name of your implementation.
 * Finally, place your JAR file and its dependencies in the <code>ext</code>
 * directory of ACE.
 *
 * @author alexandre.roman
 */
public interface ApplicationCreator {
    /**
     * Unique id for application creator.
     */
    String getId();

    /**
     * Name of application creator. This method should return a localized value.
     */
    String getName();

    /**
     * Description of application creator (one line should be enough). This
     * method should return a localized value.
     */
    String getDescription();

    /**
     * Create a new application, based on a descriptor.
     * @param desc application descriptor
     * @param dir directory where the application is created
     * @throws ApplicationCreationFailedException if application generation
     *             failed
     */
    void create(ApplicationDescriptor desc, File dir)
            throws ApplicationCreationFailedException;

    /**
     * Supported properties.
     */
    Set<PropertyDescriptor> getSupportedProperties();
}
